package com.zjb.demo.system.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.keygen.KeyGenerators;
import com.zjb.demo.common.listener.BaseOnListener;
import com.zjb.demo.common.domain.dto.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.noear.solon.validation.annotation.NotBlank;
import org.noear.solon.validation.annotation.Pattern;
import org.noear.solon.validation.annotation.Size;

import java.io.Serial;

/**
 * 字典类型表
 *
 * @author 庄佳彬
 * @since 2023/12/28 09:21
 */
@ApiModel(value = "SysDictType", description = "字典类型表")
@Table(value = "sys_dict_type", onInsert = BaseOnListener.class, onUpdate = BaseOnListener.class)
public class SysDictType extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 字典主键
     */
    @Column(value = "dict_id")
    @ApiModelProperty("字典主键")
    @ExcelProperty(value = "字典主键")
    @Id(keyType = KeyType.Generator, value = KeyGenerators.flexId)
    private Long dictId;

    /**
     * 字典名称
     */
    @Column(value = "dict_name")
    @ApiModelProperty("字典名称")
    @NotBlank(message = "字典名称不能为空")
    @Size(max = 100, message = "字典类型名称长度不能超过100个字符")
    @ExcelProperty(value = "字典名称")
    private String dictName;

    /**
     * 字典类型
     */
    @Column(value = "dict_type")
    @ApiModelProperty("字典类型")
    @NotBlank(message = "字典类型不能为空")
    @Size(max = 100, message = "字典类型类型长度不能超过100个字符")
    @Pattern(value = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头，且只能为（小写字母，数字，下滑线）")
    @ExcelProperty(value = "字典类型")
    private String dictType;

    /**
     * 状态（0正常 1停用）
     */
    @Column(value = "status")
    @ApiModelProperty("状态（0正常 1停用）")
    @ExcelProperty(value = "状态")
    private String status;

    public Long getDictId() {
        return dictId;
    }

    public void setDictId(Long dictId) {
        this.dictId = dictId;
    }

    public String getDictName() {
        return dictName;
    }

    public void setDictName(String dictName) {
        this.dictName = dictName;
    }

    public String getDictType() {
        return dictType;
    }

    public void setDictType(String dictType) {
        this.dictType = dictType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
